#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int findWinningPlayer(vector<int>& skills, int k) {
        int n = skills.size();
        int win = 0, winner = 0;
        for (int i = 1; i < n; i++)
        {
            if (skills[winner] < skills[i])
            {
                winner = i;
                win = 0;
            }
            ++win;
            if (win >= k)
            {
                return winner;
            }
        }
        return winner;
    }
};